cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
project(OracleInstallClientEvnCfg)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_PREFIX_PATH "C:\\Libs\\Qt\\Qt5.3.1\\5.3\\mingw482_32")

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
# Create code from a list of Qt designer ui files
set(CMAKE_AUTOUIC ON)

# Find the QtWidgets library
find_package(Qt5Core)
#find_package(Qt5Gui)
#find_package(Qt5Widgets)
#find_package(Qt5Sql)
#find_package(Qt5PrintSupport)

## show
get_target_property(QtCore_location Qt5::Core LOCATION)
message(STATUS ${QtCore_location})

include_directories(.)

#set(SRC posif
#        posif.cpp
#        posif.h
#        #        PosifGlobal.h
#        #        Request.cpp
#        #        Request.h
#        #        Response.cpp
#        #        Response.h
#        ##        MealCard/MealCardMain.cpp
#        ##        MealCard/MealCardForm.h
#        ##        MealCard/MealCardForm.cpp
#        ##        MealCard/MealCard.cpp
#        ##        MealCard/MealCard.h
#        #        StringProcess.cpp StringProcess.h
#        )

#对应qmake中 DEFINES += LIBTOOL_EXPORTS
#add_definitions(-DLIBLIVE_EXPORTS)
#add_definitions(-DQT_FIVE)

###########################################
##  引入自己的dll
###########################################
#link_directories(D:\\Workspaces\\Cpp\\usedll1\\cmake-build-release)
#find_library(MEALCARD_PATH MealCard D:\\Workspaces\\Cpp\\usedll1\\cmake-build-release)
#
#IF(NOT MEALCARD_PATH)
#    MESSAGE(FATAL_ERROR "libMealCard.dll not found")
#ENDIF(NOT MEALCARD_PATH)
#
##add_executable(posif WIN32 ${SRC})
#add_library(posif SHARED ${SRC})
############################################


add_executable(OrgClientEvnCfg src/ClientEvnConfig/main.cpp src/ClientEvnConfig/OrgClientEvnCfg.cpp src/ClientEvnConfig/OrgClientEvnCfg.h)
add_executable(OrgDbNameCfg src/DbNameConfig/main.cpp)




target_link_libraries(OrgClientEvnCfg Qt5::Core)
target_link_libraries(OrgDbNameCfg Qt5::Core)

###########################################
##  连接自己的dll
###########################################
#target_link_libraries(posif ${MEALCARD_PATH})
###########################################



###########################################
##  部署到指定的位置
###########################################
#IF (CMAKE_BUILD_TYPE STREQUAL Release)
#
#    set(LIB_DIR D:\\Workspaces\\Cpp\\usedll1\\cmake-build-release)
#
#    install(TARGETS posif
#            RUNTIME DESTINATION ${LIB_DIR}
#            )
#ENDIF ()
###########################################




